/* 主页配置下的接口管理 */

import http from "./http"

//  ClassiFication



// pageNumber: 1
// pageSize: 10
// categoryLevel: 1
// parentId: 0
//获取热销信息列表
const categories = (pageNumber = 1, pageSize = 10, categoryLevel = 1, parentId = 0) => {
    return http.get('/api/categories', {
        params: {
            pageNumber, pageSize, categoryLevel, parentId
        }
    })
};

//热销详细信息
const categoriesInfo = (id) => {
    return http.get(`/api/indexConfigs/${id}`)
};
//删除分类信息
const categoriesRemove = (ids) => {
    return http.delete('/api/categories', {
        data: ids
    });

};

//修改分类信息
//categoryId: 813, 
//categoryLevel: 1,
// parentId: 0, 
//categoryName: "302", 
//categoryRank: 200
const categoriesUpdate = (data) => {
    return http.put('/api/categories', data);
};
//新增热销信息
//categoryLevel: 1, 
//parentId: 0,
// categoryName: "wqwqwq", 
//categoryRank: "200"

const categoriesInsert = (data) => {
    return http.post('/api/categories', data)
}

export default {
    categories, categoriesUpdate, categoriesInfo, categoriesInsert, categoriesRemove
}